package com.example.devices.model

import com.example.common.view.model.BaseResultData
import com.example.devices.api.DevicesApiServer
import com.example.devices.entity.Devices
import com.example.devices.entity.OrderDetail
import com.example.devices.entity.OrderEntity
import okhttp3.RequestBody
import retrofit2.http.Body
import javax.inject.Inject

class DevicesRepository @Inject constructor(private val apiServer: DevicesApiServer):DevicesApiServer {
    override suspend fun getDevices(): BaseResultData<List<Devices>> {
        return apiServer.getDevices()
    }

    override suspend fun postDevices(body:RequestBody): BaseResultData<Devices> {
        return apiServer.postDevices(body)
    }

    override suspend fun getOrder(): BaseResultData<List<OrderEntity>> {
        return apiServer.getOrder()
    }

    override suspend fun getOrderDetail(id: Int): BaseResultData<OrderDetail> {
        return apiServer.getOrderDetail(id)
    }

    override suspend fun inspection(id: Int): BaseResultData<OrderDetail> {
        return apiServer.inspection(id)
    }

    override suspend fun transfer(id: Int, inspector: String): BaseResultData<OrderDetail> {
        return apiServer.transfer(id, inspector)
    }
}